package com.hejjon.visualization.controller;

import com.hejjon.visualization.bean.ResponseResult;
import com.hejjon.visualization.entity.XUser;
import com.hejjon.visualization.service.IUserService;
import com.kern.framework.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * Created by caoshi at 7:45 2021-09-17
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private IUserService userService;

    @RequestMapping("/init")
    public ResponseResult initUser() {
        XUser user = new XUser();
        user.setId(StringUtil.getUUID());
        user.setPassword("123456");
        user.setUsername("admin");
        user.setDescrip("系统初始用户");
        user.setCreatetime(new Date());
        user.setEnable(1);
        return userService.saveOrUpdate(user);
    }



}
